tests/test-help.sh \
tests/test-libarchive.sh \
tests/test-parent.sh \
- tests/test-pull-archive-z.sh \
+ tests/test-pull-archive.sh \
tests/test-pull-commit-only.sh \
tests/test-pull-depth.sh \
tests/test-pull-mirror-summary.sh \
## Initializing
For this initial discussion, we're assuming you have a single
-`archive-z2` repository:
+`archive` repository:
```
mkdir repo
-ostree --repo=repo init --mode=archive-z2
+ostree --repo=repo init --mode=archive
```
You can export this via a static webserver, and configure clients to
Further, in order to make things fast, we will need a separate
`bare-user` repository in order to perform checkouts quickly via
-hardlinks. We'll then export content into the `archive-z2` repository
+hardlinks. We'll then export content into the `archive` repository
for use by client systems.
```
Now that we have content in our `build-repo` repository (in
`bare-user` mode), we need to move the `exampleos/x86_64/standard`
-branch content into the repository just named `repo` (in `archive-z2`
+branch content into the repository just named `repo` (in `archive`
mode) for export, which will involve zlib compression of new objects.
We likely want to generate static deltas after that as well.
Amazon S3 and CDNs are a canonical target, as well as a stock static
nginx server.
-## The archive-z2 format
+## The archive format
In the [repo](repo) section, the concept of objects was introduced,
where file/content objects are checksummed and managed individually.
(Unlike a package system, which operates on compressed aggregates).
-The archive-z2 format simply gzip-compresses each content object.
+The `archive` format simply gzip-compresses each content object.
Metadata objects are stored uncompressed. This means that it's easy
-to serve via static HTTP.
+to serve via static HTTP. Note: this format used to be called `archive-z2`
+for historical reasons.
When you commit new content, you will see new `.filez` files appearing
in `objects/`.
-## archive-z2 efficiency
+## archive efficiency
-The advantages of `archive-z2`:
+The advantages of `archive`:
- It's easy to understand and implement
- Can be served directly over plain HTTP by a static webserver
are stored separately from small frequently changing data (application
code).
-Other disadvantages of `archive-z2`:
+Other disadvantages of `archive`:
- It's quite bad when clients are performing an initial pull (without HTTP/2),
- One doesn't know the total size (compressed or uncompressed) of content
## Aside: the bare and bare-user formats
-The most common operation is to pull from an `archive-z2` repository
+The most common operation is to pull from an `archive` repository
into a `bare` or `bare-user` formatted repository. These latter two
are not compressed on disk. In other words, pulling to them is
similar to unpacking (but not installing) an RPM/deb package.
would like to supply content that's updated e.g. once a month or less often.
For this model, we can do a lot better to support batched updates than
-a basic `archive-z2` repo. However, we still want to preserve the
+a basic `archive` repo. However, we still want to preserve the
model of "static webserver only". Given this, OSTree has gained the
concept of a "static delta".
The biggest feature OSTree has over Docker though is support for
(static) deltas, and even without pre-configured static deltas, the
-archive-z2 format has "natural" deltas. Particularly for a "base
+`archive` format has "natural" deltas. Particularly for a "base
operating system", one really wants on-wire deltas. It'd likely be
possible to extend Docker with this concept.
# Repository types and locations
-Also unlike git, an OSTree repository can be in one of three separate
-modes: `bare`, `bare-user`, and `archive-z2`. A bare repository is
+Also unlike git, an OSTree repository can be in one of four separate
+modes: `bare`, `bare-user`, `bare-user-only`, and `archive`. A bare repository is
one where content files are just stored as regular files; it's
designed to be the source of a "hardlink farm", where each operating
system checkout is merely links into it. If you want to store files
that repos can be stored on filesystems which do not support extended
attributes, such as tmpfs.
-In contrast, the `archive-z2` mode is designed for serving via plain
+In contrast, the `archive` mode is designed for serving via plain
HTTP. Like tar files, it can be read/written by non-root users.
On an OSTree-deployed system, the "system repository" is
particular across organizational boundaries (e.g. an upstream OS
provider, and a user that wants offline and faster access to the
content). OSTree supports both full and partial mirroring of the base
-`archive-z2` content, although not yet of static deltas.
+`archive` content, although not yet of static deltas.
-To create a mirror, first create an `archive-z2` repository (you don't
+To create a mirror, first create an `archive` repository (you don't
need to run this as root), then add the upstream as a remote, then use
`pull --mirror`.
```
-ostree --repo=repo init --mode=archive-z2
+ostree --repo=repo init --mode=archive
ostree --repo=repo remote add exampleos https://exampleos.com/ostree/repo
ostree --repo=repo pull --mirror exampleos:exampleos/x86_64/standard
```
will be interested in all of it.
The original vision of OSTree was to fulfill this "dev" role, and in
-particular the "archive-z2" format was designed for it.
+particular the "archive" format was designed for it.
Then, what you'll want to do is promote content from "dev" to "prod".
We'll discuss this later, but first, let's talk about promotion
In [Build Systems](buildsystem-and-repos.md) we saw how the
`pull-local` command can be used to migrate content from the "build"
-repository (in `bare-user` mode) into an `archive-z2` repository for
+repository (in `bare-user` mode) into an `archive` repository for
serving to client systems.
Following this section, we now have three repositories, let's call
content from `repo-build` into `repo-dev` (which involves gzip
compression among other things since it is a format change).
-When using `pull-local` to migrate content between two `archive-z2`
+When using `pull-local` to migrate content between two `archive`
repositories, the binary content is taken unmodified. Let's go ahead
and generate a new commit in our prod repository:
## Derived data - static deltas and the summary file
-As discussed in [Formats](formats.md), the `archive-z2` repository we
+As discussed in [Formats](formats.md), the `archive` repository we
use for "prod" requires one HTTP fetch per client request by default.
If we're only performing a release e.g. once a week, it's appropriate
to use "static deltas" to speed up client updates.
/* But only under these conditions */
if (is_bare || is_archive_z2_with_cache)
{
- /* Override repo mode; for archive-z2 we're looking in
+ /* Override repo mode; for archive we're looking in
the cache, which is in "bare" form */
_ostree_loose_path (loose_path_buf, checksum, OSTREE_OBJECT_TYPE_FILE, OSTREE_REPO_MODE_BARE);
if (!checkout_file_hardlink (current_repo,
g_autoptr(GInputStream) input = NULL;
g_autoptr(GVariant) xattrs = NULL;
- /* Ok, if we're archive-z2 and we didn't find an object, uncompress
+ /* Ok, if we're archive and we didn't find an object, uncompress
* it now, stick it in the cache, and then hardlink to that.
*/
if (can_cache
if test -s file-objects; then
assert_not_reached "prune didn't delete all objects"
fi
-echo "ok prune in archive-z2 deleted everything"
+echo "ok prune in archive deleted everything"
cd ${test_tmpdir}
rm -rf test2-checkout
if test "$(id -u)" != "0"; then
cd ${test_tmpdir}
rm -f expected-fail error-message
- $OSTREE init --mode=archive-z2 --repo=repo-noperm
+ $OSTREE init --mode=archive --repo=repo-noperm
chmod -w repo-noperm/objects
$OSTREE --repo=repo-noperm pull-local repo 2> error-message || touch expected-fail
chmod +w repo-noperm/objects
cd ${test_tmpdir}
mkdir mirrorrepo
-ostree_repo_init mirrorrepo --mode=archive-z2
+ostree_repo_init mirrorrepo --mode=archive
${CMD_PREFIX} ostree --repo=mirrorrepo remote add --set=gpg-verify=false origin $(cat httpd-address)/ostree/gnomerepo
${CMD_PREFIX} ostree --repo=mirrorrepo pull --mirror origin main
${CMD_PREFIX} ostree --repo=mirrorrepo fsck
${CMD_PREFIX} ostree --repo=ostree-srv/gnomerepo summary -u
rm mirrorrepo -rf
# All refs
-ostree_repo_init mirrorrepo --mode=archive-z2
+ostree_repo_init mirrorrepo --mode=archive
${CMD_PREFIX} ostree --repo=mirrorrepo remote add --set=gpg-verify=false origin $(cat httpd-address)/ostree/gnomerepo
${CMD_PREFIX} ostree --repo=mirrorrepo pull --mirror origin
${CMD_PREFIX} ostree --repo=mirrorrepo fsck
echo "ok pull mirror (all refs)"
rm mirrorrepo -rf
-ostree_repo_init mirrorrepo --mode=archive-z2
+ostree_repo_init mirrorrepo --mode=archive
${CMD_PREFIX} ostree --repo=mirrorrepo remote add --set=gpg-verify=false origin $(cat httpd-address)/ostree/gnomerepo
# Generate a summary in the mirror
${CMD_PREFIX} ostree --repo=mirrorrepo summary -u
cd ${test_tmpdir}
mkdir mirrorrepo-local
-ostree_repo_init mirrorrepo-local --mode=archive-z2
+ostree_repo_init mirrorrepo-local --mode=archive
${CMD_PREFIX} ostree --repo=mirrorrepo-local remote add --set=gpg-verify=false origin file://$(pwd)/ostree-srv/gnomerepo
${CMD_PREFIX} ostree --repo=mirrorrepo-local pull --mirror origin main
${CMD_PREFIX} ostree --repo=mirrorrepo-local fsck
cd ${test_tmpdir}
mkdir parentpullrepo
-ostree_repo_init parentpullrepo --mode=archive-z2
+ostree_repo_init parentpullrepo --mode=archive
${CMD_PREFIX} ostree --repo=parentpullrepo remote add --set=gpg-verify=false origin file://$(pwd)/ostree-srv/gnomerepo
parent_rev=$(ostree --repo=ostree-srv/gnomerepo rev-parse main^)
rev=$(ostree --repo=ostree-srv/gnomerepo rev-parse main)
+++ /dev/null
-#!/bin/bash
-#
-# Copyright (C) 2011 Colin Walters <walters@verbum.org>
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2 of the License, or (at your option) any later version.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the
-# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-# Boston, MA 02111-1307, USA.
-
-set -euo pipefail
-
-. $(dirname $0)/libtest.sh
-
-setup_fake_remote_repo1 "archive-z2"
-
-. ${test_srcdir}/pull-test.sh
--- /dev/null
+#!/bin/bash
+#
+# Copyright (C) 2011 Colin Walters <walters@verbum.org>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the
+# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+# Boston, MA 02111-1307, USA.
+
+set -euo pipefail
+
+. $(dirname $0)/libtest.sh
+
+setup_fake_remote_repo1 "archive"
+
+. ${test_srcdir}/pull-test.sh
if (!td->repo)
goto out;
- if (!ot_test_run_libtest ("setup_fake_remote_repo1 archive-z2", error))
+ if (!ot_test_run_libtest ("setup_fake_remote_repo1 archive", error))
goto out;
if (!g_file_get_contents ("httpd-address", &http_address, NULL, error))